/*
 * hal_timer.h
 *
 *  Created on: 2020610
 *      Author: Administrator
 */

#ifndef __HAL_COMMON_H__
#define __HAL_COMMON_H__

#include <rtthread.h>

#define SYS_CTX_UART_RECV_SIZE                   512

typedef enum {
    STA_CONNECTED,
    STA_CLOSED,
    STA_DATA_ARRIVED, // clients send data to wifi
    STA_EVENT_MAX,
}sys_event_e;

typedef void (*sys_status_fun)(int sock, int event);

typedef struct sys_ctx{
    int sock_id;
    sys_event_e event;
    char data_buf[SYS_CTX_UART_RECV_SIZE];
    sys_status_fun sys_status_cb;
    void *user_data;
}sys_ctx_t;

extern sys_ctx_t sys_contex;


int hal_sys_contex_init(sys_status_fun fun, void *user_data);

sys_ctx_t *hal_sys_contex_get(void);

#endif /* __HAL_COMMON_H__ */
